/**
 * <copyright>
 * </copyright>
 *

 */
package ms.unicorn.language.languagedef.impl;

import ms.unicorn.language.languagedef.Anchor;
import ms.unicorn.language.languagedef.LanguagedefPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Anchor</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ms.unicorn.language.languagedef.impl.AnchorImpl#isAnchorTop <em>Anchor Top</em>}</li>
 *   <li>{@link ms.unicorn.language.languagedef.impl.AnchorImpl#isAnchorLeft <em>Anchor Left</em>}</li>
 *   <li>{@link ms.unicorn.language.languagedef.impl.AnchorImpl#isAnchorRight <em>Anchor Right</em>}</li>
 *   <li>{@link ms.unicorn.language.languagedef.impl.AnchorImpl#isAnchorBottom <em>Anchor Bottom</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class AnchorImpl extends MinimalEObjectImpl.Container implements Anchor
{
  /**
   * The default value of the '{@link #isAnchorTop() <em>Anchor Top</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isAnchorTop()
   * @generated
   * @ordered
   */
  protected static final boolean ANCHOR_TOP_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isAnchorTop() <em>Anchor Top</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isAnchorTop()
   * @generated
   * @ordered
   */
  protected boolean anchorTop = ANCHOR_TOP_EDEFAULT;

  /**
   * The default value of the '{@link #isAnchorLeft() <em>Anchor Left</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isAnchorLeft()
   * @generated
   * @ordered
   */
  protected static final boolean ANCHOR_LEFT_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isAnchorLeft() <em>Anchor Left</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isAnchorLeft()
   * @generated
   * @ordered
   */
  protected boolean anchorLeft = ANCHOR_LEFT_EDEFAULT;

  /**
   * The default value of the '{@link #isAnchorRight() <em>Anchor Right</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isAnchorRight()
   * @generated
   * @ordered
   */
  protected static final boolean ANCHOR_RIGHT_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isAnchorRight() <em>Anchor Right</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isAnchorRight()
   * @generated
   * @ordered
   */
  protected boolean anchorRight = ANCHOR_RIGHT_EDEFAULT;

  /**
   * The default value of the '{@link #isAnchorBottom() <em>Anchor Bottom</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isAnchorBottom()
   * @generated
   * @ordered
   */
  protected static final boolean ANCHOR_BOTTOM_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isAnchorBottom() <em>Anchor Bottom</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isAnchorBottom()
   * @generated
   * @ordered
   */
  protected boolean anchorBottom = ANCHOR_BOTTOM_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected AnchorImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return LanguagedefPackage.Literals.ANCHOR;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isAnchorTop()
  {
    return anchorTop;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setAnchorTop(boolean newAnchorTop)
  {
    boolean oldAnchorTop = anchorTop;
    anchorTop = newAnchorTop;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, LanguagedefPackage.ANCHOR__ANCHOR_TOP, oldAnchorTop, anchorTop));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isAnchorLeft()
  {
    return anchorLeft;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setAnchorLeft(boolean newAnchorLeft)
  {
    boolean oldAnchorLeft = anchorLeft;
    anchorLeft = newAnchorLeft;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, LanguagedefPackage.ANCHOR__ANCHOR_LEFT, oldAnchorLeft, anchorLeft));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isAnchorRight()
  {
    return anchorRight;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setAnchorRight(boolean newAnchorRight)
  {
    boolean oldAnchorRight = anchorRight;
    anchorRight = newAnchorRight;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, LanguagedefPackage.ANCHOR__ANCHOR_RIGHT, oldAnchorRight, anchorRight));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isAnchorBottom()
  {
    return anchorBottom;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setAnchorBottom(boolean newAnchorBottom)
  {
    boolean oldAnchorBottom = anchorBottom;
    anchorBottom = newAnchorBottom;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, LanguagedefPackage.ANCHOR__ANCHOR_BOTTOM, oldAnchorBottom, anchorBottom));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case LanguagedefPackage.ANCHOR__ANCHOR_TOP:
        return isAnchorTop();
      case LanguagedefPackage.ANCHOR__ANCHOR_LEFT:
        return isAnchorLeft();
      case LanguagedefPackage.ANCHOR__ANCHOR_RIGHT:
        return isAnchorRight();
      case LanguagedefPackage.ANCHOR__ANCHOR_BOTTOM:
        return isAnchorBottom();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case LanguagedefPackage.ANCHOR__ANCHOR_TOP:
        setAnchorTop((Boolean)newValue);
        return;
      case LanguagedefPackage.ANCHOR__ANCHOR_LEFT:
        setAnchorLeft((Boolean)newValue);
        return;
      case LanguagedefPackage.ANCHOR__ANCHOR_RIGHT:
        setAnchorRight((Boolean)newValue);
        return;
      case LanguagedefPackage.ANCHOR__ANCHOR_BOTTOM:
        setAnchorBottom((Boolean)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case LanguagedefPackage.ANCHOR__ANCHOR_TOP:
        setAnchorTop(ANCHOR_TOP_EDEFAULT);
        return;
      case LanguagedefPackage.ANCHOR__ANCHOR_LEFT:
        setAnchorLeft(ANCHOR_LEFT_EDEFAULT);
        return;
      case LanguagedefPackage.ANCHOR__ANCHOR_RIGHT:
        setAnchorRight(ANCHOR_RIGHT_EDEFAULT);
        return;
      case LanguagedefPackage.ANCHOR__ANCHOR_BOTTOM:
        setAnchorBottom(ANCHOR_BOTTOM_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case LanguagedefPackage.ANCHOR__ANCHOR_TOP:
        return anchorTop != ANCHOR_TOP_EDEFAULT;
      case LanguagedefPackage.ANCHOR__ANCHOR_LEFT:
        return anchorLeft != ANCHOR_LEFT_EDEFAULT;
      case LanguagedefPackage.ANCHOR__ANCHOR_RIGHT:
        return anchorRight != ANCHOR_RIGHT_EDEFAULT;
      case LanguagedefPackage.ANCHOR__ANCHOR_BOTTOM:
        return anchorBottom != ANCHOR_BOTTOM_EDEFAULT;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (anchorTop: ");
    result.append(anchorTop);
    result.append(", anchorLeft: ");
    result.append(anchorLeft);
    result.append(", anchorRight: ");
    result.append(anchorRight);
    result.append(", anchorBottom: ");
    result.append(anchorBottom);
    result.append(')');
    return result.toString();
  }

} //AnchorImpl
